package io.renren.modules.ranking.service.impl;

import io.renren.datasources.DataSourceNames;
import io.renren.datasources.annotation.DataSource;
import io.renren.modules.ranking.dao.IllegalCrossingDao;
import io.renren.modules.ranking.dao.IllegalVehicleDao;
import io.renren.modules.ranking.dao.RoadAccidentsDao;
import io.renren.modules.ranking.entity.IllegalCrossingEntity;
import io.renren.modules.ranking.entity.IllegalVehicleEntity;
import io.renren.modules.ranking.entity.RoadAccidentsEntity;
import io.renren.modules.ranking.service.TrafficDataStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Repository
@SuppressWarnings("all")
public class TrafficDataStatServiceImpl implements TrafficDataStatService {

    @Autowired
    private IllegalCrossingDao illegalCrossingDao;
    @Autowired
    private IllegalVehicleDao illegalVehicleDao;
    @Autowired
    private RoadAccidentsDao roadAccidentsDao;

    /**
     * 查询违法高发路口
     *
     * @return
     */
    @DataSource(name = DataSourceNames.SECOND)
    @Override
    public List<IllegalCrossingEntity> queryListCrossing() {
        List<IllegalCrossingEntity> list = illegalCrossingDao.queryListCrossing();
        return list;
    }

    /**
     * 违法车辆管理-闯红灯行为6250
     *
     * @return
     */
    @DataSource(name = DataSourceNames.SECOND)
    @Override
    public List<IllegalVehicleEntity> queryListIllegalRed() {
        List<IllegalVehicleEntity> list = illegalVehicleDao.queryListIllegalRed();
        return list;

    }

    /**
     * 违法车辆管理-违法停车行为3390
     *
     * @return
     */
    @DataSource(name = DataSourceNames.SECOND)
    @Override
    public List<IllegalVehicleEntity> queryListIllegalPark() {
        List<IllegalVehicleEntity> list = illegalVehicleDao.queryListIllegalPark();
        return list;
    }

    /**
     * 事故高发路段
     *
     * @return
     */
    @DataSource(name = DataSourceNames.THIRD)
    @Override
    public List<RoadAccidentsEntity> queryListAccidentHappened() {
        List<RoadAccidentsEntity> list = roadAccidentsDao.queryListAccidentHappened();
        return list;
    }
}
